package cn.com.zpark.session;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

/**
 * @PackageName: cn.com.zpark.session
 * @ClassName: SessionDemo01
 * @Description:
 * @author: RZS
 * @date: 2021/11/15  15:31
 */
@WebServlet("/sd1.do")
public class SessionDemo01 extends HttpServlet {
    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        /**
         * 获取session对象
         */
        HttpSession session = request.getSession();
        System.out.println(session.getId());
    }
}
